/PROG  PNS0190
/ATTR
OWNER		= MNEDITOR;
COMMENT		= "CE SHI";
PROG_SIZE	= 4605;
CREATE		= DATE 18-06-24  TIME 08:43:36;
MODIFIED	= DATE 25-04-29  TIME 18:47:06;
FILE_NAME	= PNS0037;
VERSION		= 0;
LINE_COUNT	= 173;
MEMORY_SIZE	= 5145;
PROTECT		= READ_WRITE;
TCD:  STACK_SIZE	= 0,
      TASK_PRIORITY	= 50,
      TIME_SLICE	= 0,
      BUSY_LAMP_OFF	= 0,
      ABORT_REQUEST	= 0,
      PAUSE_REQUEST	= 0;
DEFAULT_GROUP	= 1,*,*,*,*;
CONTROL_CODE	= 00000000 00000000;
/APPL
/MN
   1:  !******************************** ;
   2:  !     COSMA METAL FORMING  ;
   3:  !******************************** ;
   4:  !  LINE: CHINA CHANGSHA ;
   5:  !  ROBOT: R23 ;
   6:  !  PROGRAM: PNS0190 ;
   7:  !  PART:51947408/09  ;
   8:  !  AUTHOR:HL ;
   9:  !******************************** ;
  10:   ;
  11:  !INITIALIZE ;
  12:  MOVE TO HOME    ;
  13:  R[14:CG SENSETIVE]=75    ;
  14:  R[18:PICK TIME BEFORE]=1    ;
  15:  R[19:DROP TIME BEFORE]=.2    ;
  16:   ;
  17:  !------------------------------- ;
  18:  !BEGINNING OF PROGRAM ;
  19:  CALL PARTDROP    ;
  20:  COL GUARD ADJUST R[14] ;
  21:  UTOOL_NUM=1 ;
  22:  UFRAME_NUM=0 ;
  23:  PAYLOAD[3] ;
  24:   ;
  25:  !INITIATE TO PICK-POUNCE ;
  26:J P[1:MIDDLE] 50% CNT100 ACC100    ;
  27:J P[2:PICK POUNCE] 50% CNT100 ACC100 BREAK    ;
  28:  PAUSE ;
  29:  R[1:CYCLE TOTAL]=0    ;
  30:  TIMER[1]=RESET ;
  31:  TIMER[1]=START ;
  32:   ;
  33:  LBL[10:TOP OF LOOF] ;
  34:  OVERRIDE=R[5:SPEED/SuDu] ;
  35:   ;
  36:  TIMER[3]=STOP ;
  37:  TIMER[2]=STOP ;
  38:  R[1:CYCLE TOTAL]=R[1:CYCLE TOTAL]+1    ;
  39:  R[2:LAST CYCLE TIME]=TIMER[2]    ;
  40:  R[3:LAST SPM]=60/R[2:LAST CYCLE TIME]    ;
  41:  R[8:R MOVE TIME]=TIMER[3]    ;
  42:  TIMER[2]=RESET ;
  43:  TIMER[2]=START ;
  44:  TIMER[3]=RESET ;
  45:   ;
  46:  !PROCEED TO PICK ;
  47:  LBL[20] ;
  48:  IF DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[8:P4 PICK START]=ON AND DI[40:ENABLE P4 L PICK]=ON,JMP LBL[110] ;
  49:   ;
  50:  IF DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[8:P4 PICK START]=ON,JMP LBL[120] ;
  51:   ;
  52:  IF DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[40:ENABLE P4 L PICK]=ON,JMP LBL[130] ;
  53:  IF DI[29:CYCLE STOP]=ON,JMP LBL[90] ;
  54:  JMP LBL[20] ;
  55:   ;
  56:  LBL[110:L R PART] ;
  57:  WAIT DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[8:P4 PICK START]=ON AND DI[40:ENABLE P4 L PICK]=ON    ;
  58:  TIMER[3]=START ;
  59:J P[3:PICK APPROACH] 100% CNT20 ACC100    ;
  60:   ;
  61:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK ACC100 BREAK    ;
  62:  PAYLOAD[4] ;
  63:  CALL CHK_PICK    ;
  64:  MONITOR Z_CHECH ;
  65:J P[5:PICK DEPART] 100% CNT0 ACC100    ;
  66:  DO[8:P4 PARTS OUT]=PULSE,1.0sec ;
  67:  DO[42:P4 L PART OUT]=PULSE,0.5sec ;
  68:J P[6] 100% CNT70 ACC100    ;
  69:  MONITOR END Z_CHECH ;
  70:  WAIT DI[39:P4 LEFT PART ON]=OFF    ;
  71:J P[14:DROP R PART] 100% CNT5 ACC100 TB R[19]sec,CALL PARTDROP_R    ;
  72:  DO[41:P4 L PART ON]=PULSE,1.0sec ;
  73:J P[16:PICK L DEPART] 100% CNT30 ACC100    ;
  74:J P[15:CLEAR L PART] 100% CNT100 ACC100    ;
  75:  IF DI[43:LAST BLANK]=ON,JMP LBL[115] ;
  76:  JMP LBL[30] ;
  77:  LBL[115] ;
  78:  DO[43:P4 LAST STAMPING]=PULSE,1.0sec ;
  79:  JMP LBL[30] ;
  80:   ;
  81:  LBL[120:PICK R PART] ;
  82:  WAIT DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[8:P4 PICK START]=ON    ;
  83:  TIMER[3]=START ;
  84:  OVERRIDE=R[5:SPEED/SuDu] ;
  85:J P[3:PICK APPROACH] 100% CNT50 ACC100    ;
  86:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK_R ACC100 BREAK    ;
  87:  PAYLOAD[4] ;
  88:  CALL CHECKPICK_R    ;
  89:J P[5:PICK DEPART] 100% CNT70 ACC100    ;
  90:  DO[8:P4 PARTS OUT]=PULSE,1.0sec ;
  91:  WAIT DI[39:P4 LEFT PART ON]=OFF    ;
  92:J P[6] 100% CNT100    ;
  93:J P[14:DROP R PART] 100% CNT5 ACC100 TB R[19]sec,CALL PARTDROP_R    ;
  94:  DO[41:P4 L PART ON]=PULSE,0.5sec ;
  95:J P[16:PICK L DEPART] 100% CNT100 ACC100    ;
  96:J P[2:PICK POUNCE] 100% CNT100    ;
  97:  IF DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[43:LAST BLANK]=ON,JMP LBL[121] ;
  98:  JMP LBL[122] ;
  99:  LBL[122:NOT LAST BLANK] ;
 100:J P[2:PICK POUNCE] 50% CNT100 ACC100 TA R[20]sec,DO[5:TO R34 DROP START]=PULSE,1.0sec    ;
 101:  JMP LBL[20] ;
 102:   ;
 103:  LBL[121:IS LAST BLANK] ;
 104:J P[2:PICK POUNCE] 50% CNT100 ACC100 TA    .10sec,DO[43:P4 LAST STAMPING]=PULSE,1.0sec    ;
 105:  JMP LBL[20] ;
 106:   ;
 107:  LBL[130:PICK L PART] ;
 108:  WAIT DI[1:P4 PICK ENTRY OK]=ON AND DI[3:FROM R34 CLEAR]=ON AND DI[40:ENABLE P4 L PICK]=ON    ;
 109:  TIMER[3]=START ;
 110:J P[3:PICK APPROACH] 100% CNT50 ACC100    ;
 111:   ;
 112:J P[4:PICK] 100% CNT0 TB R[18]sec,CALL PARTPICK_L ACC100 BREAK    ;
 113:  PAYLOAD[4] ;
 114:  CALL CHECKPICK_L    ;
 115:  MONITOR Z_CHECH_L ;
 116:J P[5:PICK DEPART] 100% CNT70 ACC100    ;
 117:  DO[42:P4 L PART OUT]=PULSE,1.0sec ;
 118:J P[15:CLEAR L PART] 100% CNT100 ACC100 TA    .20sec,DO[5:TO R34 DROP START]=PULSE,1.0sec    ;
 119:  JMP LBL[30] ;
 120:   ;
 121:   ;
 122:   ;
 123:  LBL[30:GOTO DROP POUNCE] ;
 124:J P[8:DROP POUNCE] 100% CNT100 ACC100 BREAK    ;
 125:   ;
 126:  TIMER[3]=STOP ;
 127:  LBL[40:AT DROP POUNCE] ;
 128:  IF DI[2:P5 DROP ENTRY]=ON AND DI[4:FROM RU5 CLEAR]=ON AND DI[5:P5 DROP START]=ON,JMP LBL[80] ;
 129:  IF DI[7:PRESS STAMPING COMPLETE]=ON AND DI[2:P5 DROP ENTRY]=ON,JMP LBL[50] ;
 130:  IF DI[18:MOVE TO CLEAR POS]=ON,JMP LBL[60] ;
 131:  JMP LBL[40] ;
 132:   ;
 133:  LBL[50:MOVE DROP SNEAK] ;
 134:  TIMER[3]=START ;
 135:  OVERRIDE=R[5:SPEED/SuDu] ;
 136:J P[9:DROP SNEAK] 100% CNT100 ACC100 BREAK    ;
 137:  LBL[51:DROP OR C-P-S] ;
 138:  IF DI[2:P5 DROP ENTRY]=ON AND DI[4:FROM RU5 CLEAR]=ON AND DI[5:P5 DROP START]=ON,JMP LBL[80] ;
 139:  IF DI[18:MOVE TO CLEAR POS]=ON,JMP LBL[40] ;
 140:  JMP LBL[51] ;
 141:  JMP LBL[50] ;
 142:   ;
 143:  LBL[60:MOVE CLS-PRS-ACC] ;
 144:J P[1:MIDDLE] 50% CNT100 ACC100    ;
 145:  PAUSE ;
 146:  JMP LBL[30] ;
 147:   ;
 148:  LBL[80:DROP ENABLED] ;
 149:  !PROCEED TO DROP ;
 150:  TIMER[3]=START ;
 151:  OVERRIDE=R[5:SPEED/SuDu] ;
 152:J P[10:DROP APPROACH] 100% CNT5 ACC100    ;
 153:  MONITOR END Z_CHECH_L ;
 154:J P[11:DROP] 100% CNT5 TB R[19]sec,CALL PARTDROP ACC100 BREAK    ;
 155:  DO[6:PART DROP COMPLETE]=PULSE,1.0sec ;
 156:  PAYLOAD[3] ;
 157:  CALL CHK_DROP    ;
 158:   ;
 159:J P[12:DROP DEPART] 100% CNT50 ACC100    ;
 160:J P[13:DROP CLEAR] 100% CNT100 ACC100    ;
 161:  DO[7:PRESS STAMPING START]=PULSE,1.0sec ;
 162:  !GOTO PICK POUNCE ;
 163:J P[2:PICK POUNCE] 100% CNT100 ACC100 BREAK    ;
 164:  IF DI[29:CYCLE STOP]=ON,JMP LBL[90] ;
 165:  JMP LBL[10] ;
 166:   ;
 167:  LBL[90:END OF CYCLE] ;
 168:  TIMER[1]=STOP ;
 169:  R[4:TOTAL CYCLE TIME]=TIMER[1]    ;
 170:J P[1:MIDDLE] 50% CNT100    ;
 171:  MOVE TO HOME    ;
 172:   ;
 173:  LBL[100:END OF PROGRAM] ;
/POS
P[1:"MIDDLE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2086.456  mm,	Y =     -.007  mm,	Z =  -901.000  mm,
	W =  -180.000 deg,	P =     -.000 deg,	R =  -180.000 deg,
	E1=   107.700 deg
};
P[2:"PICK POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2072.355  mm,	Y =  1265.661  mm,	Z =  -961.522  mm,
	W =   179.324 deg,	P =     1.370 deg,	R =   150.803 deg,
	E1=   135.022 deg
};
P[3:"PICK APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2646.193  mm,	Y =  3302.611  mm,	Z =  -912.438  mm,
	W =   179.351 deg,	P =     -.611 deg,	R =    89.316 deg,
	E1=   196.304 deg
};
P[4:"PICK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2646.194  mm,	Y =  3302.611  mm,	Z = -1068.918  mm,
	W =   179.351 deg,	P =     -.611 deg,	R =    89.316 deg,
	E1=   196.304 deg
};
P[5:"PICK DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2646.194  mm,	Y =  3302.611  mm,	Z =  -850.998  mm,
	W =   179.351 deg,	P =     -.611 deg,	R =    89.316 deg,
	E1=   196.304 deg
};
P[6]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2662.033  mm,	Y =  3265.407  mm,	Z =  -851.717  mm,
	W =  -179.997 deg,	P =    -1.502 deg,	R =    89.305 deg,
	E1=    15.747 deg
};
P[8:"DROP POUNCE"]{
   GP1:
	UF : 0, UT : 1,	
	J1=     2.359 deg,	J2=   -21.434 deg,	J3=    59.588 deg,
	J4=      .589 deg,	J5=   -57.781 deg,	J6=   189.938 deg,
	E1=    84.645 deg
};
P[9:"DROP SNEAK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2299.483  mm,	Y = -1250.625  mm,	Z =  -857.445  mm,
	W =  -178.171 deg,	P =      .792 deg,	R =  -141.268 deg,
	E1=   106.528 deg
};
P[10:"DROP APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2811.838  mm,	Y = -3277.518  mm,	Z =  -821.400  mm,
	W =  -177.856 deg,	P =      .031 deg,	R =   -80.979 deg,
	E1=   185.642 deg
};
P[11:"DROP"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2811.837  mm,	Y = -3277.518  mm,	Z =  -930.841  mm,
	W =  -177.856 deg,	P =      .031 deg,	R =   -80.979 deg,
	E1=   185.642 deg
};
P[12:"DROP DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2811.838  mm,	Y = -3277.518  mm,	Z =  -821.400  mm,
	W =  -177.856 deg,	P =      .031 deg,	R =   -80.979 deg,
	E1=   185.642 deg
};
P[13:"DROP CLEAR"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 1',
	X =  2015.126  mm,	Y =  -779.977  mm,	Z =  -923.604  mm,
	W =  -179.691 deg,	P =     1.469 deg,	R =  -162.123 deg,
	E1=   153.611 deg
};
P[14:"DROP R PART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2662.033  mm,	Y =  3265.407  mm,	Z =  -966.197  mm,
	W =  -179.997 deg,	P =    -1.502 deg,	R =    89.305 deg,
	E1=    15.747 deg
};
P[15:"CLEAR L PART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  1995.805  mm,	Y =   612.943  mm,	Z =  -898.818  mm,
	W =   179.636 deg,	P =     1.663 deg,	R =   174.237 deg,
	E1=    72.481 deg
};
P[16:"PICK L DEPART"]{
   GP1:
	UF : 0, UT : 1,	
	J1=    36.132 deg,	J2=   -24.223 deg,	J3=    55.914 deg,
	J4=    -2.379 deg,	J5=   -54.699 deg,	J6=    54.284 deg,
	E1=    16.125 deg
};
/END
